package com.guigu.pd.auth.dao;

import com.guigu.pd.auth.entity.AuthRoleEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * 
 * 
 * @author deyran
 * @email deyran@gmail.com
 * @date 2022-07-19 19:05:57
 */
@Mapper
@Repository
public interface AuthRoleDao extends BaseMapper<AuthRoleEntity> {

    @Select("select COUNT(*) from `pd_auth_user_role` where role_id =#{roleid} and user_id = #{userid} ")
    int queryuser(@Param("roleid") int roleid, @Param("userid") int userid);

    @Select("SELECT COUNT(*) FROM `pd_auth_role_menu` WHERE role_id =#{role_id} AND menu_id =#{menu_id}")
    int querymenu(@Param("roleid") int roleid, @Param("menuid") int menuid);


}
